package com.thkj.modules.sys.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.thkj.common.util.RequestUtil;
import com.thkj.modules.sys.service.RequestLogService;

import dp.R;
import dp.dao.PagingList;
import dp.web.BaseAction;

@RestController
@RequestMapping("/backstage/requestLog")
public class RequestLogAction extends BaseAction{

    @Autowired
    RequestLogService requestLogService;

    @RequestMapping("")
    public ModelAndView index(){
        return new ModelAndView("requestLog");
    }

    @RequestMapping("/query")
    public R query(HttpServletRequest request, int page, int size){
        Map param = RequestUtil.getParameterMap(request);
        PagingList<Map> list = requestLogService.getRequestLogs(param, page, size);
        return R.success(list);
    }
}
